# -*- coding: utf-8 -*-
from utils.database import Database
from utils.http_requester import http_request_wrapper

# @allure.step("2.发送HTTP请求")
@http_request_wrapper
def send_http_request(**request_data):
    return request_data

    # print("=" * 100)
    # print(request_data)
    # res = requests.request(**request_data)
    #
    # logging.info(f"2.发送HTTP请求, 响应文本为: {res.text}")
    #
    # # chen:修改
    # response_time = res.elapsed.microseconds / 1000
    #
    # # chen：写入慢接口数据
    # ApiLogger(slow_api_path()).log_request(res.url,res.request.method,request_data["params"],request_data["data"],request_data["json"],response_time)
    #
    # res = {"status_code": res.status_code, "response_time": response_time, "data": res.json()}
    #
    # return res


def send_jdbc_request(sql):
    result = Database().get_one(sql)
    return result
    # conn = pymysql.Connect(
    #     host=DB_HOST,
    #     port=DB_PORT,
    #     database=DB_NAME,
    #     user=DB_USER,
    #     password=DB_PASSWORD,
    #     charset="utf8"
    # )
    # cur = conn.cursor()
    # cur.execute(sql)
    # result = cur.fetchone()
    # cur.close()
    # conn.close()

